<div class="main-content">
	<header>
		<h2>Advertisment Request</h2>
	</header>

	<section>
		<table class="datatable paginate sortable full">
			<thead>
			<tr>
				<th>Name</th>
				<th>Package</th>
				<th>Picture</th>
				<th>Status</th>
				<th>Created At</th>
				<th style="width:70px"></th>
			</tr>
			</thead>
			<tbody>
			<?php foreach ($ads as $ad){ ?>
			<tr>
				<td align="center"><a href="<?php echo bu('admin/ads/show/').$ad->id; ?>"><?php echo $ad->name; ?></a></td>
				<td align="center"><?php echo $ad->package; ?></td>
				<td align="center"><img src="<?php echo bu('assets/ads/').$ad->picture ?>" width="100" /></td>
				<td align="center">
          <?php if($ad->status == Ads::STATUS_PENDING){ ?>
            <img src="<?php echo bu('images/cross.png'); ?>" title="Pending" />
          <?php }else{ ?>
            <img src="<?php echo bu('images/accept.png'); ?>" title="Approved" />
          <?php }; ?>
        </td>
				<td align="center"><?php echo Helpers::customDate($ad->created_at); ?></td>
				<td>
				<ul class="action-buttons">
          <?php if($ad->status == Ads::STATUS_PENDING){ ?>
					<li><a href="<?php echo bu('admin/ads/approve'); ?>?id=<?php echo $ad->id; ?>" method="POST" class="button button-gray no-text"><span class="accept"></span>Approve</a></li>
          <?php }else{ ?>
          <li><a href="<?php echo bu('admin/ads/decline'); ?>?id=<?php echo $ad->id; ?>" method="POST" class="button button-gray no-text"><span class="decline"></span>Decline</a></li>
          <?php }; ?>
					<li><a href="<?php echo bu('admin/ads/delete'); ?>?id=<?php echo $ad->id; ?>" method="POST" class="button button-gray no-text"><span class="bin"></span>Delete</a></li>
				</ul>
				</td>
			</tr>
			<?php } ?>
			</tbody>
		</table>
	</section>
</div>